gtkmediafile: Only unmap the GstVideoFrame in the GBytes destroy notify
authorSebastian Dröge <sebastian@centricular.com>
Sat, 26 Dec 2020 12:26:23 +0000 (14:26 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 26 Dec 2020 12:26:23 +0000 (14:26 +0200)
commit6e108d310a2fe145938fc6d9fc875032122d0ab6
tree6c064d474b6b79cf92c18a40897d8336a7f72bda
parent9c84fa127a33e33e8dc5e93adb5e40d3a46b2dbc
gtkmediafile: Only unmap the GstVideoFrame in the GBytes destroy notify

The memory pointed to by GstVideoFrame::plane_data becomes invalid after
unmapping causing the GBytes to point at some random memory if the
unmapping is not deferred until its destroy notify.

When the GStreamer buffer is backed by normal system memory this is not
a problem but if it is backed by e.g. an OpenGL texture, dmabuf or some
other hardware-specific memory this will otherwise cause interesting
problems.
modules/media/gtkgstsink.c